package com.isky.visual.db.mapper;

import com.isky.visual.db.entity.Datastore;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Repository;

/**
 * <p>
 * 结果集 Mapper 接口
 * </p>
 *
 * @author wudl
 * @since 2020-04-23
 */
@Mapper
@Repository
public interface DatastoreMapper extends BaseMapper<Datastore> {

    @Update("update datastore set valid = 0 where id =#{id}")
    int logicDelete(@Param("id") Long id);

    @Update("update datastore set valid = 0 where dbid =#{dbId}")
    int logicDeleteByDbId(@Param("dbId") Long dbId);

    @Update("update datastore set stat_name = #{name} where id =#{id}")
    int rename(@Param("id") Long id, @Param("name") String name);
}
